package com.pay.common.enums;

/**
 * 退款状态枚举
 */
public enum RefundStatusEnum {


    REFUND_APPLY("1","退款申请中"),
    REFUND_BANK_PROCESS("2","银行处理中"),
    REFUND_SUCCESS("0","成功"),
    REFUND_FAIL("-1","失败");


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private String code;

    private String msg;


    RefundStatusEnum(String code , String msg){
        this.code = code;
        this.msg = msg;
    }


    /**
     * 根据code获取msg
     * @param code
     * @return
     */
    public String  getMsg(String code){

        for (RefundStatusEnum refundStatusEnum : RefundStatusEnum.values()){

            if (code.equals(refundStatusEnum.getCode())){

                return refundStatusEnum.getMsg();
            }

        }

        return null;
    }

}
